﻿if (typeof Axis == "undefined") Axis = {};
if (typeof Axis.View == "undefined") Axis.View = {};
if (typeof Axis.View.News == "undefined") Axis.View.News = {};

Axis.View.News.List = {
    Init: function () {
        this.GetData();
    },
    GetData: function () {


        var paramObj = { ID: NewsID };
        var url = '/Views/News/Service/NewsService.asmx/GetNewsRelation';
        $.ajax({
            url: url,
            cache: false,
            data: JSON.stringify(paramObj),
            datatype: 'json',
            contentType: 'application/json',
            type: 'post',
            success: function (pData) {
           
                Axis.View.News.List.ShowNewsList(pData.d);
            }
        });
    }
  ,
    ShowNewsList: function (pData) {
        var htmlContent = "";
        var pattern = '<li class="fl liNewMore">'
                        + '<a title="{0}" href="../News/{1}#{2}"  class="aLiNewMore">'
                        + '<h4> {0} ({3})</h4>'
                        + '</a></li>';
        var data = eval("(" + pData+ ")");
        $.each(data, function (index, Item) {
            var _date = $.CFormat.FormatDateSerializer(Item.WritenDate);
            htmlContent += $.string.Format(pattern, Item.Title, Item.ID, $.ReplacePoint(Item.Title), _date);
        });
        $(".ulNewMore").html(htmlContent);
    }
};
$(function () {
    Axis.View.News.List.Init();
});
function ShowDetail(id, cateID) {
    window.location.assign($.string.Format("../News/{0}", id, cateID));
}